package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.CurrencyBlockMapper;
import com.ruoyi.web.domain.CurrencyBlock;
import com.ruoyi.web.service.ICurrencyBlockService;

/**
 * 区块Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-30
 */
@Service
public class CurrencyBlockServiceImpl implements ICurrencyBlockService 
{
    @Autowired
    private CurrencyBlockMapper currencyBlockMapper;

    /**
     * 查询区块
     * 
     * @param id 区块主键
     * @return 区块
     */
    @Override
    public CurrencyBlock selectCurrencyBlockById(Long id)
    {
        return currencyBlockMapper.selectCurrencyBlockById(id);
    }

    /**
     * 查询区块列表
     * 
     * @param currencyBlock 区块
     * @return 区块
     */
    @Override
    public List<CurrencyBlock> selectCurrencyBlockList(CurrencyBlock currencyBlock)
    {
        return currencyBlockMapper.selectCurrencyBlockList(currencyBlock);
    }

    /**
     * 新增区块
     * 
     * @param currencyBlock 区块
     * @return 结果
     */
    @Override
    public int insertCurrencyBlock(CurrencyBlock currencyBlock)
    {
        currencyBlock.setCreateTime(DateUtils.getNowDate());
        return currencyBlockMapper.insertCurrencyBlock(currencyBlock);
    }

    /**
     * 修改区块
     * 
     * @param currencyBlock 区块
     * @return 结果
     */
    @Override
    public int updateCurrencyBlock(CurrencyBlock currencyBlock)
    {
        currencyBlock.setUpdateTime(DateUtils.getNowDate());
        return currencyBlockMapper.updateCurrencyBlock(currencyBlock);
    }

    /**
     * 批量删除区块
     * 
     * @param ids 需要删除的区块主键
     * @return 结果
     */
    @Override
    public int deleteCurrencyBlockByIds(Long[] ids)
    {
        return currencyBlockMapper.deleteCurrencyBlockByIds(ids);
    }

    /**
     * 删除区块信息
     * 
     * @param id 区块主键
     * @return 结果
     */
    @Override
    public int deleteCurrencyBlockById(Long id)
    {
        return currencyBlockMapper.deleteCurrencyBlockById(id);
    }
}
